#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iomanip>
using namespace std;

typedef long long ll;
static int BASE = (int)1e8;
static int WIDTH = 8;
struct BigInteger{


    vector<int> v;

    explicit BigInteger(const ll x = 0) {*this = x;}
    explicit BigInteger(const string x){*this = x;}
    BigInteger& operator =(const ll x){
        v.clear();
        if(x<BASE) v.push_back((int)x);
        else{
            v.push_back(x%BASE);
            v.push_back(x/BASE);
        }
        return *this;
    }
    BigInteger& operator = (const string &x){
        v.clear();
        for (int i = x.size()-1; i >=0 ; --i) {
            if(isdigit(x[i])) v.push_back(x[i]-'0');
            if(isalpha(x[i])) v.push_back(x[i]-'A'+10);
        }
        return *this;
    }

    friend istream& operator >> (istream &in, BigInteger &x){
        string s;
        if(cin >> s) x = s;
        return in;
    }

    void DeleteZero(){
        int cnt = 0;
        for (auto i = v.rbegin();  i!= v.rend(); ++i) {
            if(*i == 0) ++cnt;
            else break;
        }
        v.resize(v.size()-cnt);
    }

    friend ostream& operator << (ostream &out, BigInteger &x){
        if(x.v.back() >9) cout << (char)(x.v.back()-10+'A');
        else out << x.v.back();
        for (int i = (int)x.v.size()-2; i >=0 ; --i) {
            if(x.v[i] >9) cout << (char)(x.v[i]-10+'A');
            else out << setfill('0') << setw(WIDTH) << x.v[i];
        }
        return out;
    }

    friend bool operator <(const BigInteger &a, const BigInteger &b){
        return a.v.size() < b.v.size()
               ||(a.v.size() == b.v.size() && a.v.back() < b.v.back());
    }

    friend BigInteger operator +(BigInteger &a, BigInteger &b){
        BigInteger res;
        res.v.clear();
        int c = 0;
        int i=0;
        while(i<a.v.size() || i<b.v.size() || c!=0){
            if(i<a.v.size()) c += a.v[i];
            if(i<b.v.size()) c += b.v[i];
            res.v.push_back(c%BASE);
            c /= BASE;
            ++i;
        }
        res.DeleteZero();
        return res;
    }
    BigInteger& operator +=(BigInteger &a){return *this = *this + a;}

    friend BigInteger operator -(BigInteger &a, BigInteger &b){
        BigInteger res;
        res.v.clear();
        int c = 0;
        int i=0;
        bool neg = false;
        if(a<b) {swap(a,b); neg = true;}
        bool carry = false;
        while(i<a.v.size()){
            c = a.v[i];
            if(i<b.v.size()) c -= b.v[i];
            if(carry) c-=1;
            if(c<0){
                carry = true;
                c+= BASE;
            }
            else carry = false;
            if(neg && i==a.v.size()-1) res.v.push_back(-c);
            else res.v.push_back(c);
            ++i;
        }
        res.DeleteZero();
        return res;
    }

    friend BigInteger operator *(const BigInteger &a, const BigInteger &b){
        BigInteger res, tmp;

        for (int i = 0; i < b.v.size(); ++i) {
            for (int j = 0; j < a.v.size(); ++j) {
                ll t = (ll)b.v[i]*(ll)a.v[j];
                tmp = (BigInteger)t;
                for (int k = 0; k < i+j; ++k) {
                    tmp.v.insert(tmp.v.begin(), 0);
                }
                res += tmp;
            }
        }

        res.DeleteZero();
        return res;
    }


};

int main() {
    ios_base::sync_with_stdio(false);cin.tie(nullptr);
    int n; cin >> n; BASE = n; WIDTH = 1;
    BigInteger a, b, c;
    cin >> a >> b;
    c = a+b;
    cout << c;
    return 0;
}